package util

import (
	"fmt"
	"math/rand"
	"strconv"
	"time"
)

func RandomId() int {
	now := time.Now().Format("20060102150405")
	i := rand.Intn(10000)
	id, err := strconv.Atoi(fmt.Sprintf("%s%d", now, i))
	if err != nil {
		panic(err)
	}
	return id
}

func MsgId() int {
	return time.Now().Nanosecond()
}
